home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / EMULATOR / SPECCY / !Spectrum / PCsnaps / SpecUtils / SnapInfo < prev    next >
Text File  |  1993-09-04  |  5KB  |  160 lines

  1.  
  2.                             .Z80 files
  3.  
  4. The .Z80 files are a slightly packed Spectrum memory dump format. A .Z80 file
  5. starts off with a 30-byte header-block. In this block, the status of the
  6. emulated Z80 processor at the point at which the Z80-emulator was stopped by
  7. the user is specified. A few extra environmental variables complete the
  8. header.
  9.  
  10.         Byte    Length  Description
  11.         0       1       A register
  12.         1       1       F register
  13.         2       2       BC register pair (LSB, i.e. C, first)
  14.         4       2       HL register pair
  15.         6       2       Program counter
  16.         8       2       Stack pointer
  17.         10      1       Interrupt register
  18.         11      1       Refresh register (Bit 7 is not significant!)
  19.         12      1       Bit 0  : Bit 7 of the R-register
  20.                         Bit 1-3: Border colour
  21.                         Bit 4  : 1=SamRom switched in
  22.                         Bit 5  : 1=Block of data is 'squeezed'
  23.                         Bit 6-7: No meaning
  24.         13      2       DE register pair
  25.         15      2       BC' register pair
  26.         17      2       DE' register pair
  27.         19      2       HL' register pair
  28.         21      1       A' register
  29.         22      1       F' register
  30.         23      2       IY register (Again LSB first)
  31.         25      2       IX register
  32.         27      1       Interrupt flipflop, 0=DI, otherwise EI
  33.         28      1       IFF2 (not particularly important...)
  34.         29      1       Bit 0-1: Interrupt mode (0, 1 or 2)
  35.                         Bit 2  : 1=Issue 2 emulation
  36.                         Bit 3  : 1=Double interrupt frequency
  37.                         Bit 4-5: 1=High video synchronisation
  38.                                  3=Low video synchronisation
  39.                                  0,2=Normal
  40.                         Bit 6-7: 0=Cursor/Protek/AGF joystick
  41.                                  1=Kempston joystick
  42.                                  2=Sinclair 1 joystick
  43.                                  3=Sinclair 2 joystick
  44.  
  45. After these 30 bytes, a memory dump of the emulated Spectrum follows,
  46. consisting of the bytes at address 16384 up to 65535.  The first versions of
  47. the Spectrum Emulator just dumped the full  48K after the header. These
  48. versions therefore produced .Z80  files that were 49182 bytes (=48K + 30
  49. bytes) in length. The  shareware versions of the Emulator all use a slightly
  50. different  method of storing the 48K datablock, thereby reducing the size  of
  51. the .Z80 files. In effect, the method consists of finding all  sequences of
  52. equal bytes, and replacing them by a code of four  bytes, "ED ED xx yy" which
  53. tells that byte yy is to repeated xx  times. An example will make it clear:
  54.  
  55.                 ED 00 44 ED ED 05 00 02 ...             (.Z80 file)
  56.  
  57.         is translated back into
  58.  
  59.                 ED 00 44 00 00 00 00 00 02 ...          (Spec-memory)
  60.  
  61. Obviously, only sequences of length at least 4 will be coded, for otherwise
  62. there would be no gain in the number of stored bytes. Sequences of 'ED' are
  63. treated separately: the minimum length of an 'ED'-sequence to be coded is 2,
  64. to avoid problems when translating back. And lastly, if a single 'ED' is
  65. encountered, thus an 'ED' followed by a different byte, then this byte
  66. following the 'ED' will not be included in a block. This is done to avoid 'ED
  67. 00 00 00 00 00' to be translated into 'ED ED ED 05 00' which would not be
  68. translated back correctly. This particular sequence of bytes will be coded
  69. into 'ED 00 ED ED 04 00'. 
  70.  
  71.                     The snapshot file format
  72.                     ========================
  73.  
  74. This format (filetype .SNA) is the format used by the Mirage 
  75. Microdriver "Dump" command.  It is also used by Peter McGavin's 
  76. Spectrum emulator for the Amiga.
  77.  
  78.  Byte offset    Contents
  79.  
  80.     0          i  register
  81.     1          l' register
  82.     2          h' register
  83.     3          e' register
  84.     4          d' register
  85.     5          c' register
  86.     6          b' register
  87.     7          f' register
  88.     8          a' register
  89.     9          l  register
  90.    10          h  register
  91.    11          e  register
  92.    12          d  register
  93.    13          c  register
  94.    14          b  register
  95.    15          iy low register
  96.    16          iy high register
  97.    17          ix low register
  98.    18          ix high register
  99.    19          bit 2 contains iff2
  100.    20          r register
  101.    21          flags register
  102.    22          a register
  103.    23          sp low register
  104.    24          sp high register
  105.    25          interrupt mode (0, 1 or 2)
  106.    26          border colour (0..7).
  107.  27..49178     48 kbytes ram dump
  108.  
  109.   Since Peter's emulator stores rubbish in byte 26 JPP sets the 
  110. border to black if byte 26 is larger than 7.
  111.  
  112.  
  113.  
  114.  
  115.  
  116.                 ARC   SPECULATOR
  117.                         ================
  118.  
  119. Snapshots are 64.25k long!!!! The first 256 bytes hold the processor state
  120. (and other details?). The next 65536 bytes contain a complete image of the
  121. whole spectrum memory map, including the ROM!
  122. Note that the program counter stored value is 256 less than the actual value?
  123.  
  124.  
  125. 00: = REG A
  126. 04: = REG F?
  127. 08: = REG B
  128. 0C: = REG C
  129. 10: = REG D
  130. 14: = REG E
  131. 18: = REG H
  132. 1C: = REG L
  133. 20: = PC LO
  134. 21: = PC HI -1
  135. 28: = SP LO
  136. 29: = SC HI
  137.  
  138. 9C: = BORDER COLOUR
  139.  
  140. A4: = Imode?
  141. BE: = REG I
  142. BF: = IFF ??
  143.  
  144. EC: = REG A'
  145. ED: = REG F'?
  146. F0: = REG B'
  147. F1: = REG C'
  148. F4: = REG D'
  149. F5: = REG E'
  150. F6: = REG H'
  151. F7: = REG L'
  152. F8: = REG IX LO
  153. F9: = REG IX HI
  154. FC: = REG IY LO
  155. FD: = REG IY HI
  156.  
  157.    
  158. ??: = Refresh register
  159.  
  160.